﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<BlogPlat.Model.Post>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Index</h2>

    <table>
        <tr>
            <th></th>
            <th>
                ID
            </th>
            <th>
                AuthorUsername
            </th>
            <th>
                PostTitle
            </th>
            <th>
                PostSummary
            </th>
            <th>
                PostContent
            </th>
            <th>
                DatePublished
            </th>
            <th>
                IsDraft
            </th>
            <th>
                ViewCount
            </th>
            <th>
                FriendlyUrl
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%: Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) %> |
                <%: Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ })%> |
                <%: Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })%>
            </td>
            <td>
                <%: item.ID %>
            </td>
            <td>
                <%: item.AuthorUsername %>
            </td>
            <td>
                <%: item.PostTitle %>
            </td>
            <td>
                <%: item.PostSummary %>
            </td>
            <td>
                <%: item.PostContent %>
            </td>
            <td>
                <%: String.Format("{0:g}", item.DatePublished) %>
            </td>
            <td>
                <%: item.IsDraft %>
            </td>
            <td>
                <%: item.ViewCount %>
            </td>
            <td>
                <%: item.FriendlyUrl %>
            </td>
        </tr>
    
    <% } %>

    </table>    

</asp:Content>

